package edu.sandau.b23015110.service;

import edu.sandau.b23015110.mapper.CustomerMapper;
import edu.sandau.b23015110.model.Customer;
import edu.sandau.b23015110.repository.CustomerRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class CustomerService {

    @Autowired
    private CustomerMapper customerMapper;
    @Autowired
    private CustomerRepository customerRepository;

    public List<Customer> findAll(Customer customer){
        return customerMapper.findAll(customer);
    }

    public  void deleteById(String id) {
        customerMapper.deleteById(id);
    }

    public void save(Customer s) {
        customerMapper.save(s);
    }



    public Customer getReferenceById(String id) {
        return customerMapper.getReferenceById(id);
    }


    public void update(Customer s) {
        customerMapper.update(s);
    }
}
